package com.lyz.dataStructure.algorithm.美团2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 16:12
 * @Description:
 **/


import java.util.HashMap;
import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/22 16:12
 *@Description:
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s =sc.nextLine();
        String s1 = s.toUpperCase();
        HashMap<Character,Integer> map = new HashMap();
        for(int i =0;i<s1.length();i++){
            map.put(s1.charAt(i),i);
        }
        int count = 0;
        int index = 0;
        for(int i =0;i<s1.length();i++){
            count =Math.max(count,map.get(s1.charAt(i)));
            if(i==count){
                if(count==s1.length()-1){
                    System.out.println(count+1-index);
                    break;
                }else {
                    System.out.print(count+1-index+" ");
                    index =count+1;
                }
            }
        }
    }
}
